package com.jevons.muffin.fragment;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ViewSwitcher;

import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.ViewModel;

import com.jevons.muffin.R;
import com.jevons.muffin.activity.BaseView;
import com.jevons.muffin.vm.BasePresenter;
import com.trello.rxlifecycle3.LifecycleTransformer;

/**
 * Fragment 基类
 * @author linaisheng
 * Created at 2019/3/29.
 */

public abstract class BaseBindingFragment<DB extends ViewDataBinding, P extends BasePresenter>
        extends BaseFragment<P> {

    protected DB dataBinding;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        dataBinding = DataBindingUtil.inflate(inflater, getContentView(), container, false);
        dataBinding.setLifecycleOwner(this);
        return dataBinding.getRoot();
    }

    @Override
    protected P initPresenter() {
        return null;
    }

    @Override
    protected ViewModel initViewModel() {
        return null;
    }

}
